package com.example.example6;

import android.os.Bundle;
import android.os.IBinder;
import android.app.Activity;
import android.content.ComponentName;
import android.content.ServiceConnection;
import android.view.Menu;
import android.widget.Button;
import android.widget.Toast;

public class MainActivity extends Activity {

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_main);
        
        ServiceConnection mConnection=new ServiceConnection() {
			
			@Override
			public void onServiceDisconnected(ComponentName name) {
				// TODO Auto-generated method stub
				
			}
			
			@Override
			public void onServiceConnected(ComponentName name, IBinder service) {
				LocalService mBoundService= ((LocalService.LocalBinder)service).getService();
				Toast.makeText(MainActivity.this, "Binding....", Toast.LENGTH_LONG).show();
			}
		};
        
        Button btnBind= (Button) findViewById(R.id.bind);
        Button btnUnBind= (Button) findViewById(R.id.unbind);
        Button btnPlay= (Button) findViewById(R.id.play);
    }


    @Override
    public boolean onCreateOptionsMenu(Menu menu) {
        // Inflate the menu; this adds items to the action bar if it is present.
        getMenuInflater().inflate(R.menu.main, menu);
        return true;
    }
    
}
